package cn.bonoon.kernel.security;

import java.util.Collection;
import java.util.Date;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;

public class KeyAuthenticationToken extends PreAuthenticatedAuthenticationToken{

	/**
	 * 
	 */
	private static final long serialVersionUID = -5582840700811309526L;

	private final Date beginAt, endAt; 
	private final String key;
	
	public KeyAuthenticationToken(
			Object principal, 
			Object credentials, 
			Collection<? extends GrantedAuthority> authorities,
			String key,
			Date beginAt, Date endAt) {
		super(principal, credentials, authorities);

        this.key = key;
        this.beginAt = beginAt;
        this.endAt = endAt;
	}

	public Date getBeginAt() {
		return beginAt;
	}

	public Date getEndAt() {
		return endAt;
	}

	public String getKey() {
		return key;
	}
}
